package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.system.domain.ZzxxChapter;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ZzxxChapterMapper;
import com.ruoyi.system.service.IZzxxChapterService;

/**
 * 章节信息表Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-06-20
 */
@Service
public class ZzxxChapterServiceImpl implements IZzxxChapterService 
{
    @Autowired
    private ZzxxChapterMapper zzxxChapterMapper;

    /**
     * 查询章节信息表
     * 
     * @param id 章节信息表主键
     * @return 章节信息表
     */
    @Override
    public ZzxxChapter selectZzxxChapterById(Long id)
    {
        return zzxxChapterMapper.selectZzxxChapterById(id);
    }

    /**
     * 查询章节信息表列表
     * 
     * @param zzxxChapter 章节信息表
     * @return 章节信息表
     */
    @Override
    public List<ZzxxChapter> selectZzxxChapterList(ZzxxChapter zzxxChapter)
    {
        return zzxxChapterMapper.selectZzxxChapterList(zzxxChapter);
    }

    /**
     * 新增章节信息表
     * 
     * @param zzxxChapter 章节信息表
     * @return 结果
     */
    @Override
    public int insertZzxxChapter(ZzxxChapter zzxxChapter)
    {
        zzxxChapter.setCreateTime(DateUtils.getNowDate());
        return zzxxChapterMapper.insertZzxxChapter(zzxxChapter);
    }

    /**
     * 修改章节信息表
     * 
     * @param zzxxChapter 章节信息表
     * @return 结果
     */
    @Override
    public int updateZzxxChapter(ZzxxChapter zzxxChapter)
    {
        zzxxChapter.setUpdateTime(DateUtils.getNowDate());
        return zzxxChapterMapper.updateZzxxChapter(zzxxChapter);
    }

    /**
     * 批量删除章节信息表
     * 
     * @param ids 需要删除的章节信息表主键
     * @return 结果
     */
    @Override
    public int deleteZzxxChapterByIds(Long[] ids)
    {
        return zzxxChapterMapper.deleteZzxxChapterByIds(ids);
    }

    /**
     * 删除章节信息表信息
     * 
     * @param id 章节信息表主键
     * @return 结果
     */
    @Override
    public int deleteZzxxChapterById(Long id)
    {
        return zzxxChapterMapper.deleteZzxxChapterById(id);
    }
}
